﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Data.SqlClient;

namespace $safeprojectname$
{
	[DataContract]
	public class Environment
	{
		[DataContract]
		public class DatabaseEnvironment
		{
			[DataMember]
			public String FullConnectionString
			{
				get;
				set;
			}
			public string ServerConnectionString
			{
				get
				{
					var builder = new SqlConnectionStringBuilder(FullConnectionString);
					builder.InitialCatalog = "";
					return builder.ToString();
				}
			}
			public string DatabaseName
			{
				get
				{
					return new SqlConnectionStringBuilder(FullConnectionString).InitialCatalog;
				}
			}
		}

		[DataMember]
		public DatabaseEnvironment Database
		{
			get;
			set;
		}
	}
}
